var share_source = 'test.com';
var share_source_url = 'http://example.com/';
var share_title = '测试一下,have a try';
/**
 * sina
 * 
 */
function share_post_to_sina(){
	(function(s,d,e,r,l,p,t,z,c){
		var f='http://v.t.sina.com.cn/share/share.php?',
			u=z||d.location,
			p=[ 'url=',share_source_url,
				'&title=',e(share_title),
				'&source=',e(share_source),
				'&sourceUrl=',e(share_source_url),
				'&content=',c||'gb2312','&pic=',e(p||'')].join('');
		function a(){
			if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');
		};
		if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();
	})(screen,document,encodeURIComponent,'WP-share','http://iamduyu.cn/',null,null,null,null);
}
/**
 * tencent
 * 
 */
function share_post_to_tencent(){
	var _t = encodeURI(share_title);
	var _url = encodeURIComponent(share_source_url);
	var _appkey = encodeURI("appkey");//你从腾讯获得的appkey
	var _pic = encodeURI('');//（例如：var _pic='图片url1|图片url2|图片url3....）
	var _site = share_source;//你的网站地址
	var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t;
	window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
/**
 * netease
 * 
 */
 function share_post_to_netease(){
	 http://t.163.com/article/user/checkLogin.do?&info=-&link=&source=%E7%88%B1%E6%8B%8D%E6%B8%B8%E6%88%8F
	 window.open('http://t.163.com/article/user/checkLogin.do?'+
	    	 'link='+share_source+ 
	    	 '&source=网易微博'+
	    	 '&info='+encodeURIComponent(share_title)+
	    	 ' '+encodeURIComponent(share_source_url)
	    	 ,
	    	 '_blank',
	    	 'width=510,height=300');
}
/**
 * renren
 * 
 */
 function share_post_to_renren(){
     (function(s,d,e){
         if(/xiaonei\.com/.test(d.location))
             return;
         var f='http://share.xiaonei.com/share/buttonshare.do?link=',
         u=share_source_url,
         l=share_title,
         p=[e(u),'&amp;title=',e(l)].join('');
         function a(){
             if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))
                 u.href=[f,p].join('');
         };
         if(/Firefox/.test(navigator.userAgent))
             setTimeout(a,0);
         else a();
    })(screen,document,encodeURIComponent);
 }
/**
 * kaixin001
 * 
 */
 function share_post_to_kaixin001(){
	 d=document;
	 t=d.selection?(d.selection.type!='None'?
	    	 d.selection.createRange().text:''):
    	    	 (d.getSelection?d.getSelection():'');
	   void(kaixin=window.open('http://www.kaixin001.com/~repaste/repaste.php?&amp;rurl='+
	    	   escape(share_source_url)+
	    	   '&amp;rtitle='+share_title+
	    	   '&amp;rcontent='+share_title,
	    		'_blank',
    	 		'width=510,height=300'));
	   kaixin.focus();
}
 /**
  * douban
  * 
  */
 function share_post_to_douban(){
	 var d=document,
	 e=encodeURIComponent,
	 s1=window.getSelection,
	 s2=d.getSelection,
	 s3=d.selection,
	 s=s1?s1():s2?s2():s3?s3.createRange().text:'',
	 r='http://www.douban.com/recommend/?'+
	 	'url='+e(share_source_url)+
	 	'&title='+e(share_title)+
	 	'&sel='+e(s)+
	 	'&v=1',
	 x=function(){
		 if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))
			 location.href=r+'&r=1'
	 };
	if(/Firefox/.test(navigator.userAgent)){
		setTimeout(x,0)
	}else{
		x()
	}
}  
 /**
  * qzone
  * 
  */
 function share_post_to_qzone(){
	 window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?'+
			 'url='+encodeURIComponent(share_source_url)+
			 '&rcontent='+share_title
			 ,'_blank'
			 ,'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');  
 }